package com.kinggm.service.impl;

import com.kinggm.mapper.PersonMapper;
import com.kinggm.model.Person;
import com.kinggm.service.PersonService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service
public class PersonServiceImpl implements PersonService {

    @Resource
    private PersonMapper personMapper;


    @Override
//    @Transactional(rollbackFor = Exception.class)
    public int save(Person person) {
        personMapper.insert(person);
        return person.getId();
    }
}
